x86: fix (and simplify) MTRR overlap checking
authorJan Beulich <jbeulich@suse.com>
Thu, 21 Jan 2016 15:11:04 +0000 (16:11 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 21 Jan 2016 15:11:04 +0000 (16:11 +0100)
commit3272230848f36eb5bbb660216898a90048a81d9f
tree4b4e47eedae765fba4112c39f03176c8eed775a0
parent53de839fb40936c074213a0c400e3c959e4ec461
x86: fix (and simplify) MTRR overlap checking

Obtaining one individual range per variable range register (via
get_mtrr_range()) was bogus from the beginning, as these registers may
cover multiple disjoint ranges. Do away with that, in favor of simply
comparing masked addresses.

Also, for is_var_mtrr_overlapped()'s result to be correct when called
from mtrr_wrmsr(), generic_set_mtrr() must update saved state first.

As minor cleanup changes, constify is_var_mtrr_overlapped()'s parameter
and make mtrr_wrmsr() static.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/cpu/mtrr/generic.c
xen/arch/x86/cpu/mtrr/mtrr.h
xen/arch/x86/hvm/mtrr.c
xen/include/asm-x86/mtrr.h